]> dgit.raspbian.org Git - ostree.git/commitdiff
ci: Use Justfile targets in GitHub workflow and add missing v2024_7 feature
authorXiaofeng Wang <henrywangxf@me.com>
Tue, 31 Mar 2026 07:31:32 +0000 (15:31 +0800)
committerXiaofeng Wang <henrywangxf@me.com>
Tue, 31 Mar 2026 08:09:17 +0000 (16:09 +0800)
- Replace inline cargo fmt/clippy commands in rust.yml with just
  cargo-fmt-check and just cargo-clippy for consistency with local dev
- Make Justfile cargo-clippy use CARGO_PROJECT_FEATURES env var
  (defaults to v2022_6) so CI and local use share the same config
- Add missing v2024_7 feature to Cargo.toml to fix cargo doc failure
  caused by unexpected cfg condition

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
.github/workflows/rust.yml
Cargo.toml
Justfile
rust-bindings/src/repo.rs

index 5f8b8bf0f707e07ddc6997db43f5dfd4cfd2bfcb..1f95a94abdf299a367535ebe9234555170d8fa60 100644 (file)
@@ -23,23 +23,16 @@ jobs:
       - uses: actions/checkout@v2
       - name: Cache Dependencies
         uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
+      - name: Install just
+        run: dnf install -y just
       - name: cargo fmt (check)
-        run: |
-          cargo fmt -p ostree -- --check -l
-          for d in tests/inst tests/bootc-integration tests/xtask; do
-            cargo fmt --manifest-path $d/Cargo.toml -- --check -l
-          done
+        run: just cargo-fmt-check
       - name: Build
         run: cargo build --verbose --features=${{ env['CARGO_PROJECT_FEATURES'] }}
       - name: Run tests
         run: cargo test --verbose --features=${{ env['CARGO_PROJECT_FEATURES'] }}
       - name: cargo clippy
-        run: |
-          CLIPPY_CONFIG="-A clippy::all -D clippy::correctness -D clippy::suspicious -Dunused_imports -Ddead_code"
-          cargo clippy -p ostree --features=${{ env['CARGO_PROJECT_FEATURES'] }} -- $CLIPPY_CONFIG
-          for d in tests/inst tests/bootc-integration tests/xtask; do
-            cargo clippy --manifest-path $d/Cargo.toml -- $CLIPPY_CONFIG
-          done
+        run: just cargo-clippy
       - name: cargo doc
         run: env RUSTDOCFLAGS='-D warnings' cargo doc --lib -p ostree --features=${{ env['CARGO_PROJECT_FEATURES'] }}
   build-no-features:
index 87206896d4f6e116c508248b5f23aed0f316791d..13819b4bec7e4ed34a1dc031369651450c38f7dd 100644 (file)
@@ -101,6 +101,7 @@ v2022_7 = ["v2022_6", "ffi/v2022_7"]
 v2023_1 = ["v2022_7", "ffi/v2023_1"]
 v2023_8 = ["v2023_1", "ffi/v2023_8"]
 v2023_11 = ["v2023_8", "ffi/v2023_11"]
-v2025_1 = ["v2023_11", "ffi/v2025_1"]
+v2024_7 = ["v2023_11", "ffi/v2024_7"]
+v2025_1 = ["v2024_7", "ffi/v2025_1"]
 v2025_2 = ["v2025_1", "ffi/v2025_2"]
 v2025_3 = ["v2025_2", "ffi/v2025_3"]
index 64840429f4db0ec6d10a213840448cf6f25ab8b1..385d9ec34bed3b732a55bd53395b799bef6e78bd 100644 (file)
--- a/Justfile
+++ b/Justfile
@@ -135,6 +135,7 @@ clang-format-check:
     {{sourcefiles}} | xargs clang-format -i --Werror --dry-run
 
 clippy_config := "-A clippy::all -D clippy::correctness -D clippy::suspicious -Dunused_imports -Ddead_code"
+cargo_project_features := env('CARGO_PROJECT_FEATURES', 'v2022_6')
 
 # Run all Rust lint and format checks (mirrors CI)
 validate:
@@ -148,5 +149,5 @@ cargo-fmt-check:
 
 # Run cargo clippy across all crates
 cargo-clippy:
-    cargo clippy -p ostree --features=v2022_6 -- {{clippy_config}}
+    cargo clippy -p ostree --features={{cargo_project_features}} -- {{clippy_config}}
     for d in tests/inst tests/bootc-integration tests/xtask; do cargo clippy --manifest-path $d/Cargo.toml -- {{clippy_config}}; done
index b689daa21c9c9aa7d0adf41ffa35272deeb4dac0..ff826c75fb05c0c5f81fa3b750b7be66ef19513f 100644 (file)
@@ -68,7 +68,7 @@ unsafe fn from_glib_container_variant_map(
 
 /// An open transaction in the repository.
 ///
-/// This will automatically invoke [`ostree::Repo::abort_transaction`] when the value is dropped.
+/// This will automatically invoke [`Repo::abort_transaction`] when the value is dropped.
 pub struct TransactionGuard<'a> {
     /// Reference to the repository for this transaction.
     repo: Option<&'a Repo>,
@@ -115,7 +115,7 @@ impl Repo {
         crate::Repo::open_at(dir.as_raw_fd(), path, gio::Cancellable::NONE)
     }
 
-    /// A version of [`create_at`] which resolves the path relative to the provided directory file descriptor, and also returns the opened repo.
+    /// A version of [`Repo::create_at`] which resolves the path relative to the provided directory file descriptor, and also returns the opened repo.
     #[cfg(any(feature = "v2017_10", feature = "dox"))]
     pub fn create_at_dir(
         dir: BorrowedFd<'_>,
@@ -128,7 +128,7 @@ impl Repo {
         Repo::open_at_dir(dir, path)
     }
 
-    /// A wrapper for [`prepare_transaction`] which ensures the transaction will be aborted when the guard goes out of scope.
+    /// A wrapper for [`Repo::prepare_transaction`] which ensures the transaction will be aborted when the guard goes out of scope.
     pub fn auto_transaction<P: IsA<gio::Cancellable>>(
         &self,
         cancellable: Option<&P>,
@@ -307,7 +307,7 @@ impl Repo {
 
     /// Query metadata for a content object.
     ///
-    /// This is similar to [`load_file`], but is more efficient if reading the file content is not needed.
+    /// This is similar to [`Repo::load_file`], but is more efficient if reading the file content is not needed.
     pub fn query_file<P: IsA<gio::Cancellable>>(
         &self,
         checksum: &str,